<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>SSE</title>
</head>
<body>
<div id="sse"></div>
<script>
  let eventSource = new EventSource('/sse/stream');
  eventSource.onmessage = function(event){
    document.getElementById("sse").innerHTML= event.data;
  }
  // eventSource.addEventListener("foo", (event)=>{
  //     document.getElementById("sse").innerHTML= event.data;
  // });
  // eventSource.addEventListener("end", (event)=>{
  //   document.getElementById("sse").innerHTML= event.data;
  //     eventSource.close();
  // });
</script>
</body>
</html>